package com.yanqu.road.logic.activity.foxcard.game.effect;

import com.yanqu.road.entity.activity.foxcard.FoxBaseCard;
import com.yanqu.road.entity.activity.foxcard.FoxHandCard;
import com.yanqu.road.logic.activity.foxcard.game.FoxCardCombo;
import com.yanqu.road.logic.activity.foxcard.game.FoxCardGameLogic;
import com.yanqu.road.logic.activity.foxcard.game.eFoxCardTriggerType;

import java.util.Collections;
import java.util.List;

/**
 * 打出的牌计分时是指定花色，可以触发加成效果
 * params:花色|加筹码|乘筹码|加倍率|乘倍率|金币
 */
public class FoxCardEffect3 extends FoxCardEffectBase {
    @Override
    protected void effectHandle(FoxCardGameLogic gameLogic, FoxHandCard handCard) {
        if (triggerType != eFoxCardTriggerType.SCORE) {
            return;
        }
        if (handCard == null) {
            return;
        }

        Integer checkColor = Integer.valueOf(effectConfig.getParamsList().get(0));
        if (handCard.getColor() == checkColor || gameLogic.getConfig().isAllColorHandCard(handCard.getReinforceEffect())) {
            List<FoxBaseCard> foxEffectCards = Collections.singletonList(effectCard);
            List<FoxBaseCard> triggerCards = Collections.singletonList(handCard);
            gameLogic.addBaseScore(Integer.valueOf(effectConfig.getParamsList().get(1)), foxEffectCards, triggerCards); //加基础筹码
            gameLogic.addBaseScoreMulti(Integer.valueOf(effectConfig.getParamsList().get(2)), foxEffectCards, triggerCards); //当前基础筹码乘算
            gameLogic.addBaseMulti(Integer.valueOf(effectConfig.getParamsList().get(3)), foxEffectCards, triggerCards); //加基础倍率
            gameLogic.addBaseMultiMulti(Integer.valueOf(effectConfig.getParamsList().get(4)), foxEffectCards, triggerCards); //当前基础倍率乘算
            gameLogic.goldChange(Integer.valueOf(effectConfig.getParamsList().get(5)), foxEffectCards, triggerCards, triggerType); //加金币
        }
    }
}
